        SUBT    High level Filing System interface
OldOpt  SETA    {OPT}
        OPT     OptNoList+OptNoP1List

; ***********************************
; ***    C h a n g e   L i s t    ***
; ***********************************

; Date       Name  Description
; ----       ----  -----------
; 12-Oct-87  SKS   Add OSGBPB_ReadDirEntriesCatInfo
; 06-Nov-87  SKS   Add offsets in ReadDirEntriesInfo
; 28-Jan-88  SKS   Add cc_rfs number
; 08-Feb-88  SKS   Add FSControl_FileTypeFromString
; 01-Mar-88  SKS   Add ramfs number
; 24-Mar-88  SKS   Add FSControl_FileInfo
; 25-Mar-88  SKS   Add FSControl_ReadFSName
; 26-May-88  SKS   Add FSControl_SetContexts
; 04-Jun-88  SKS   Add OSFile_MakeError
; 03-Aug-88  SKS   Add unixfs number
; 15-Sep-88  SKS   Add digitape_number
; 25-Jan-89 NReeves Add scsifs_number
; 20-Feb-89  APT   Correct UnixFS name
; 24-Feb-89  BC    Add TVFS filing system number
; 09-Mar-89  BC    Add ScanFS filing system number
; 20-Mar-89  BC    Add MultiFS filing system number for JSmith
; 05-Jun-89  BC    Added fsnumber_Fax for Computer Concepts Fax Pack
; 14-Jul-89  TMD   Added fsnumber_Z88 for Colton Software
; 18-Jul-89  BC    Added fsnumber_SCSIDeskFS for JB  
; 02-Aug-89  JSR   Added fsnumber_NFS
; 08-Aug-89  BC    Added fsnumber_Serial2 for The Soft Option
; 09-Aug-89 NRaine Removed deviant extra definition of fsnumber_Serial2
; 15-Aug-89  BC    Allocated fsnumber_dfs (4) to PRES
; 21-Aug-89  BC    Allocated fsnumber_DFSDeskFS (35) to PRES, deallocated 4
; 07-Sep-89 NRaine Allocated fsnumber_dayibmfs (36) to Daylight Software
; 02-Oct-89  BC    Allocated fsnumber_CDFS (37) to Next Technology
; 10-Nov-89 NRaine Allocated fsnumber_BBScanFS to David Spencer (Beebug)
; 10-Nov-89  BC    Allocated fsnumber_loader (41) for DSL/Acorn broadcast loader
; 05-Jan-90  WS    Allocated fsnumber_chunkfs (42) for Computer Concepts
; 29-Jan-90  BC    Allocated fsnumber_MSDOSFS (43) primarily for Minerva
; 29-Jan-90  BC    Allocated fsnumber_NoRiscFS (44) for Minerva
; 20-Feb-90  BC    Allocated fsnumber_Nexus (45) for SJ Research
; 22-Feb-90 NRaine Allocated fsnumber_resourcefs (46) for "Resources:"
; 27-Apr-90 NRaine Allocated fsnumber_pipefs (47) for "Pipe:"
; 08-May-90  BC    Allocated fsnumber_NexusFilerFS (48) for SJ Research
; 08-May-90  BC    Re-Structured filing system number allocations
; 12-Jun-90  BC    Allocated fsnumber_IDEFS (49) for Sefan Frhling
; 11-Jul-90  BC    Allocated fsnumber_CCPrintFS (50) for Computer Concepts
; 17-Jul-90  BC    Allocated fsnumber_BrainsoftVFS (51) for Brainsoft
; 17-Jul-90  BC    Allocated fsnumber_BrainsoftSFS (52) for Brainsoft
; 13-Sep-90  BC    Changed lfs: to pc: (38) for Computer Concepts
; 14-Sep-90 JRoach Added several OS_FSControls:
;                       FSControl_RegisterImageFS (35)
;                       FSControl_DeRegisterImageFS (36)
;                       FSControl_CanonicalisePath (37)
;                       FSControl_InfoToFileType (38)
;                  Added this OS_Args:
;                       OSArgs_ReadPath (7)
;                  Added these OS_Files:
;                       OSFile_ReadWithType (20)
;                       OSFile_ReadWithTypePath (21)
;                       OSFile_ReadWithTypePathVar (22)
;                       OSFile_ReadWithTypeNoPath (23)
;                  Added this OS_GBPB:
;                       OSGBPB_ReadDirEntriesFileType (12)
; 19-Oct-90 JRoach Added a couple of OS_FSControls:
;                       FSControl_URD (39)
;                       FSControl_Back (40)
; 22-Nov-90 JRoach Added a couple of OS_FSControls:
;                       FSControl_DefectList (41)
;                       FSControl_AddDefect (42)
;
; 18-Dec-90  DDV   Allocate fsnumber_DevicesFS (53) for "Devices:" (Acorn)
;            DDV   Allocate fsnumber_ParallelFS (54) for "parallel:" (Acorn)
; 11-Jan-91  BC    Allocate fsnumber_VCMNetFS (55) for VCM-Net, David Miller
; 11-Jan-91  BC    Allocate fsnumber_ArcFS (56) M. Smith (came via CS)
; 20-Jan-91  JSR   Added FSControl_NoDir, _NoURD and _NoLib (43-45)
; 19-Feb-91  BC    Allocate fsnumber_NexusPrintFS (57) for SJ Research
; 26-Feb-91  JAB   Allocated fsnumber_AtomWidePIA (58) for Atomwide
; 04-Mar-91  BC    Allocated fsnumber_RSDosFS (59) for Rob Schrauwen (came via CS)
; 15-Mar-91  JSR   Add OSFile_ReadBlockSize
;                      FSControl_UsedSpaceMap
;                      FSControl_ReadBootOption
;                      FSControl_WriteBootOption
; 09-Apr-91  JSR   Add FSControl_ReadFreeSpace (49)
; 26-Apr-91  JSR   Add FSControl_NameDisc (50)
; 29-Apr-91  JSR   Add FSControl_StampImage (51)
;                      OSArgs_ImageStampIs (8)
; 09-May-91  JSR   Add FSControl_ObjectAtOffset (52)
; 19-Jun-91  JAB   Allocated fsnumner_SimtrondbFS for Simtron (60)
; 01-Jul-91  BC    Allocated fsnumber_PSCompressFS
; 18-Jul-91  JAB   Allocated fsnumber_DabsArcDFS (61)
; 02-Aug-91  JAB   Allocated fsnumber_DTSoftPCCFS (63)
; 07-Aug-91 JRoach Added FSControl_SetDir (53)
; 15-Aug-91  AMG   Allocated fsnumber_RAMJetFS (64) (Cust Svc ref 3619)
; 02-Sep-91 JRoach Allocated fsnumber_MenonFS (&79)
; 12-Sep-91 JRoach Added FSControl_ReadDir
; 13-Sep-91  AMG   Changed RAMJetFS to RAMJtFS at author's request (64)
; 09-Jan-92  JAB   Added fsnumber_JBPShareFS (65)
; 23-Jan-92  amg   Added comment for OSFile 36
; 17-Feb-92  JAB   Added fsnumber_DPSparkFS (66)
; 17-Feb-92  JAB   Added fsnumber_ArxeQuadFS (67)
; 09-Apr-92  JAB   Added fsnumber_SPFLOPFS (68)
; 09-Apr-92  JAB   Added fsnumber_AOZBootFS (69)
; 09-Apr-92  JAB   Added fsnumber_AOZCardFS (70)
; 09-Apr-92  JAB   Added fsnumber_AOZISCSFS (71)
; 15-Apr-92  JSR   Added fsnumber_SPSTFS (128) for Lingenuity's Snapshot board
; 12-Jun-92  JAB   Added fsnumber_LindisTempFS (73) for Lindis temp filing system
; 27-Jul-92  JAB   Added fsnumber_DTSRAMFS (74) for DT Software static RAM fs
; 21-Aug-92  JAB   Added fsnumber_PsionFS (75) for Computer Concepts
; 02-Sep-92  JAB   Added fsnumber_RemoteFS (76) for Atomide
; 04-Sep-92  PJC   Added fsnumber_MirrorFS (77)
; 08-Sep-92  JAB   Added fsnumber_LinkFS (78) for MicroTest (for CS)
; 04-Nov-92  RM    Added fsnumber_FTPFS  (79)
; 12-Nov-92  JAB   Added fsnumber_NetGain (80) for Digital Services
; 10-Dec-92  amg   Added fsnumber_AppFS (81) for Les Want
; 05-Mar-93  JAB   added fsnumber_EasyPrint (82) for Cumana
; 16-Mar-93  Diz   Added fsnumber_HFS (83) for David De Vorchik (not Acorn)
; 29-Mar-93  JAB   Added fsnumber_TankFS (84) for Alan Williams, Acorn OZ
; 21-Apr-93  JAB   Added fsnumber_HDFS (85) for David Reid, Greyhound Marketing
; 26-Apr-93  JAB   Added fsnumber_FontFS (86) for Adrian Look, LOOK Systems
; 20-May-93  JAB   Added fsnumber_CDNet (87) for Patrick Gribben, PEP Associates
; 26-May-93  JAB   Added fsnumber_MOFS (88) for Hugo, Serial Port
; 05-Jul-93  JAB   Added fsnumber_PCCardFS (89) Neil Critchell, Acorn
; 09-Jul-93  JAB   Added fsnumber_SJTape (90) for Owen Smith, SJ Research
; 24-Jul-93  JAB   Added fsnumber_MemFS (91) for Nick Smith
; 29-Sep-93  RM    Added fsnumber_FastFS (93) for STNC
; 15-Oct-93  JAB   Added fsnumber_ExpressFS (94) for Armstrong Walker Ltd
; 12-Nov-93  JAB   Added fsnumber_ROFS (95) for David Knell
; 15-Nov-93  JAB   Added fsnumber_Address (96) for Kasoft (CS14483)
; 15-Nov-93  JAB   Added fsnumber_HDCD (97) for Markus Huber (CS14732)
; 15-Nov-93  JAB   Added fsnumber_KleinFS (98) for PTW Software
; 06-Dec-93  KSR   Added fsnumber_ShareFS (99)
; 07-Feb-94  JAB   Changes "NexusPrintFS:" to "NexusPrint:"
; 08-Jun-94  AMcC  Extracted Filing System numbers to Hdr:FSNumbers
; 03-Nov-94  amg   Add FSControl 55-57 definitions

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Reason codes in r0b for OSFile
; ==============================

OSFile_Load             *       &FF     ; Uses File$Path
OSFile_Save             *       0
OSFile_WriteInfo        *       1
OSFile_WriteLoad        *       2
OSFile_WriteExec        *       3
OSFile_WriteAttr        *       4
OSFile_ReadInfo         *       5       ; Uses File$Path
OSFile_Delete           *       6
OSFile_Create           *       7
OSFile_CreateDir        *       8
OSFile_SetStamp         *       9       ; These ops don't get passed to a Filing System
OSFile_SaveStamp        *       10
OSFile_CreateStamp      *       11
OSFile_LoadPath         *       12      ; Uses given path
OSFile_ReadPath         *       13      ; Uses given path
OSFile_LoadPathVar      *       14      ; Uses given path variable
OSFile_ReadPathVar      *       15      ; Uses given path variable
OSFile_LoadNoPath       *       16      ; No nonsense load
OSFile_ReadNoPath       *       17      ; No nonsense read
OSFile_SetType          *       18
OSFile_MakeError        *       19

; OS_Files introduced in 1.70 FileSwitch
OSFile_ReadWithType     *       20      ; Uses File$Path
OSFile_ReadWithTypePath *       21      ; Uses supplied path
OSFile_ReadWithTypePathVar *    22      ; Uses supplied path var
OSFile_ReadWithTypeNoPath *     23      ; Uses no path
OSFile_ReadBlockSize    *       24      ; natural block size of a file
                                              
; Skip 36 when we get there. It is used by a virus which relies on getting
; VS back when it's not active, and VC when it is.

load_at_given   *       0       ; Load at address given in r2
load_at_own     *       -1      ; Load at file's own address


; Object type (r0 in OSFile)

object_nothing   *      0
object_file      *      1
object_directory *      2


; Attribute bits (r5 in OSFile)

read_attribute          *       1 :SHL: 0
write_attribute         *       1 :SHL: 1
locked_attribute        *       1 :SHL: 3
public_read_attribute   *       1 :SHL: 4
public_write_attribute  *       1 :SHL: 5


; Reason codes in r0 for FSControl
; ================================

                                        ^ 0
FSControl_Dir                           # 1 ; 0
FSControl_Lib                           # 1 ; 1
FSControl_StartApplication              # 1 ; 2
FSControl_RunType                       # 1 ; 3
FSControl_Run                           # 1 ; 4
FSControl_Cat                           # 1 ; 5
FSControl_Ex                            # 1 ; 6
FSControl_LCat                          # 1 ; 7
FSControl_LEx                           # 1 ; 8
FSControl_Info                          # 1 ; 9
FSControl_Opt                           # 1 ; 10
FSControl_StarMinus                     # 1 ; 11 - Was LIBFS run on PRB

FSControl_AddFS                         # 1 ; 12 - Really new functions begin here
FSControl_LookupFS                      # 1 ; 13
FSControl_SelectFS                      # 1 ; 14
FSControl_BootupFS                      # 1 ; 15
FSControl_RemoveFS                      # 1 ; 16
FSControl_AddSecondaryFS                # 1 ; 17
FSControl_ReadFileType                  # 1 ; 18
FSControl_RestoreCurrent                # 1 ; 19
FSControl_ReadModuleBase                # 1 ; 20
FSControl_ReadFSHandle                  # 1 ; 21
FSControl_Shut                          # 1 ; 22
FSControl_ShutDown                      # 1 ; 23
FSControl_Access                        # 1 ; 24
FSControl_Rename                        # 1 ; 25
FSControl_Copy                          # 1 ; 26
FSControl_Wipe                          # 1 ; 27
FSControl_Count                         # 1 ; 28
FSControl_CreateHandle                  # 1 ; 29
FSControl_ReadSecondaryModuleBase       # 1 ; 30
FSControl_FileTypeFromString            # 1 ; 31
FSControl_FileInfo                      # 1 ; 32
FSControl_ReadFSName                    # 1 ; 33
FSControl_SetContexts                   # 1 ; 34

FSControl_RegisterImageFS               # 1 ; 35 - Functions introduced post Risc OS 2.00 start here
FSControl_DeRegisterImageFS             # 1 ; 36
FSControl_CanonicalisePath              # 1 ; 37
FSControl_InfoToFileType                # 1 ; 38
FSControl_URD                           # 1 ; 39
FSControl_Back                          # 1 ; 40
FSControl_DefectList                    # 1 ; 41
FSControl_AddDefect                     # 1 ; 42
FSControl_NoDir                         # 1 ; 43
FSControl_NoURD                         # 1 ; 44
FSControl_NoLib                         # 1 ; 45
FSControl_UsedSpaceMap                  # 1 ; 46
FSControl_ReadBootOption                # 1 ; 47
FSControl_WriteBootOption               # 1 ; 48
FSControl_ReadFreeSpace                 # 1 ; 49
FSControl_NameDisc                      # 1 ; 50
FSControl_StampImage                    # 1 ; 51
FSControl_ObjectAtOffset                # 1 ; 52
FSControl_SetDir                        # 1 ; 53
FSControl_ReadDir                       # 1 ; 54

FSControl_ReadFreeSpace64               # 1 ; 55 - These introduced after RISC OS 3.50
FSControl_DefectList64                  # 1 ; 56
FSControl_AddDefect64                   # 1 ; 57

; Aliases (to be removed)

FSControl_OPT                * FSControl_Opt       
FSControl_RUN                * FSControl_Run
FSControl_CAT                * FSControl_Cat
FSControl_SHUT               * FSControl_Shut

; Sub-reasons to FSControl_StampImage
FSControl_StampImage_NextUpdate *       0
FSControl_StampImage_Now        *       1

; Directory types for FSControl_SetDir
Dir_Current     * 0
Dir_Previous    * 1
Dir_UserRoot    * 2
Dir_Library     * 3

; Some useful reason codes in r0b for OSFind
; ==========================================

OSFind_OpenIn   *       open_read
OSFind_OpenOut  *       open_write
OSFind_OpenUp   *       open_update

OSFind_ReadFile *       open_read :OR: open_mustopen :OR: open_nodir


; Bits in r0b (open mode) for OSFind
; ==================================

open_write      *       2_10000000
open_read       *       2_01000000
open_update     *       open_write :OR: open_read

open_mustopen   *       2_00001000      ; Always give error if not found
open_nodir      *       2_00000100      ; Always give error if is a dir

open_default    *       2_00000000      ; Use File$Path
open_pathstring *       2_00000001      ; Use supplied path string
open_pathvar    *       2_00000010      ; Use supplied path variable
open_nopath     *       2_00000011      ; Don't use any path for lookup
open_pathbits   *       2_00000011

open_unused     *       2_00110000      ; Will give 'Bad Mode' error if used


; Reason codes in r0b for OSArgs stream operations
; ================================================

OSArgs_ReadPTR  *       0
OSArgs_SetPTR   *       1
OSArgs_ReadEXT  *       2
OSArgs_SetEXT   *       3
OSArgs_ReadSize *       4       ; New function. Maybe combine with ReadInfo ?
OSArgs_EOFCheck *       5       ; New function. Replaces FSCV(1) call
OSArgs_EnsureSize *     6       ; New function

OSArgs_ReadPath *       7       ; Function introduced in 1.70 FileSwitch
OSArgs_ImageStampIs *   8       ; Function introduced in 1.80 FileSwitch

OSArgs_ReadInfo *       &FE     ; New function
OSArgs_Flush    *       &FF


; Reason codes in r0b for OSGBPB
; ==============================

                        ^ 1     ; Perverse, eh ?

OSGBPB_WriteAtGiven     # 1 ; 1
OSGBPB_WriteAtPTR       # 1 ; 2
OSGBPB_ReadFromGiven    # 1 ; 3
OSGBPB_ReadFromPTR      # 1 ; 4

OSGBPB_ReadDiscName     # 1 ; 5
OSGBPB_ReadCSDName      # 1 ; 6
OSGBPB_ReadLIBName      # 1 ; 7
OSGBPB_ReadCSDEntries   # 1 ; 8

OSGBPB_ReadDirEntries   # 1 ; 9
OSGBPB_ReadDirEntriesInfo # 1 ; 10
OSGBPB_ReadDirEntriesCatInfo # 1 ; 11

; These introduced in FileSwitch 1.70:
OSGBPB_ReadDirEntriesFileType # 1 ; 12


                ^       0
RDE_load        #       4
RDE_exec        #       4
RDE_length      #       4
RDE_attr        #       4
RDE_type        #       4
RDE_name        #       0


; File type definitions (real defs in Documents.Allocation.DateDoc)
; =====================

Absolute_LoadAddr  * &FFFFF800
Sprite_LoadAddr    * &FFFFF900
BASIC_LoadAddr     * &FFFFFB00
Transient_LoadAddr * &FFFFFC00
Data_LoadAddr      * &FFFFFD00
Command_LoadAddr   * &FFFFFE00
Text_LoadAddr      * &FFFFFF00

EOF_char * &FE                  ; Unfortunately, &1FE isn't an immediate value

        OPT     OldOpt
        END
